home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 May: Tool Chest / Dev.CD May 97 TC.toast / Sample Code / QuickDraw / OffSample / OffSample.h next >
Encoding:
C/C++ Source or Header  |  1994-11-18  |  5.3 KB  |  153 lines  |  [TEXT/MPS ]

  1. /*------------------------------------------------------------------------------
  2. #
  3. #    Apple Macintosh Developer Technical Support
  4. #
  5. #    Offscreen Buffer Sample Application
  6. #
  7. #    OffSample
  8. #
  9. #    POffSample.h    -    Rez Include Source
  10. #
  11. #    Copyright © 1989 Apple Computer, Inc.
  12. #    All rights reserved.
  13. #
  14. #    Versions:    
  15. #                1.00                04/89
  16. #                1.01                06/92
  17. #
  18. #    Components:
  19. #                OffSample.p            April 1, 1989
  20. #                OffSample.r            April 1, 1989
  21. #                OffSample.h            April 1, 1989
  22. #                OffSample.rsrc        April 1, 1989
  23. #                POffSample.make        April 1, 1989
  24. #
  25. #    Requirements:
  26. #                Offscreen.p            April 1, 1989
  27. #                Offscreen.inc1.p    April 1, 1989
  28. #                UFailure.p            November 1, 1988
  29. #                UFailure.inc1.p        November 1, 1988
  30. #                UFailure.a            November 1, 1988
  31. #
  32. #    OffSample demonstrates the usage of the Offscreen
  33. #    unit. It shows how to use offscreen pixmaps and
  34. #    bitmaps to produce flicker-free updating with a
  35. #    minimum of re-structuring of code. OffSample attempts
  36. #    to reduce the amount of 'knowledge' that it has of
  37. #    the offscreen structure so as to minimize its
  38. #    dependence on that unit.
  39. #
  40. #    OffSample emphasizes using the Offscreen unit; it
  41. #    is not intended to be viewed as a complete application
  42. #    from which to base some larger effort. Instead, its
  43. #    method of using offscreen bitmaps and pixmaps should
  44. #    be studied and adapted to other applications that
  45. #    desire features such as flicker-free updating.
  46. #
  47. ------------------------------------------------------------------------------*/
  48.  
  49. #define kMinSize                75        /* application's minimum size (in K) */
  50.  
  51. #define kPrefSize                245        /* application's preferred size (in K) */
  52.  
  53. #define    rMenuBar                128        /* application's menu bar */
  54. #define    rAboutAlert                128        /* about alert */
  55. #define    rUserAlert                129        /* error user alert */
  56. #define    rWindow                    128        /* application's window */
  57.  
  58. /* kSysEnvironsVersion is passed to SysEnvirons to tell it which version of the
  59.    SysEnvRec we understand. */
  60.  
  61. #define    kSysEnvironsVersion        1
  62.  
  63. /* kOSEvent is the event number of the suspend/resume and mouse-moved events sent
  64.    by MultiFinder. Once we determine that an event is an osEvent, we look at the
  65.    high byte of the message sent to determine which kind it is. To differentiate
  66.    suspend and resume events we check the resumeMask bit. */
  67.  
  68. #define    kOSEvent                app4Evt    /* event used by MultiFinder */
  69. #define    kSuspendResumeMessage    1        /* high byte of suspend/resume event message */
  70. #define    kResumeMask                1        /* bit of message field for resume vs. suspend */
  71. #define    kMouseMovedMessage        0xFA    /* high byte of mouse-moved event message */
  72.  
  73. #define    sErrStrings                128
  74.  
  75. #define    kNoBackBuff                128
  76. #define    kNoEditBuff                129
  77. #define    kTitle                    130
  78. #define    kColorPrompt            131
  79. #define    kNoWantBack                132
  80. #define    kNoWantEdit                133
  81.  
  82. /* The following constants are used to identify menus and their items. The menu IDs
  83.    have an "m" prefix and the item numbers within each menu have an "i" prefix. */
  84.  
  85. #define    mApple                    128        /* Apple menu */
  86. #define    iAbout                    1
  87.  
  88. #define    mFile                    129        /* File menu */
  89. #define    iNew                    1
  90. #define    iClose                    4
  91. #define    iQuit                    12
  92.  
  93. #define    mEdit                    130        /* Edit menu */
  94. #define    iUndo                    1
  95. #define    iCut                    3
  96. #define    iCopy                    4
  97. #define    iPaste                    5
  98. #define    iClear                    6
  99.  
  100. #define    mShape                    131        /* Shape menu */
  101.  
  102. #define mSpecial                132        /* Special menu */
  103. #define iUseBack                1
  104. #define iUseEdit                2
  105. #define iPickColor                4
  106.  
  107. /*    kTopLeft - This is for positioning the Disk Initialization dialogs. */
  108.  
  109. #define kDITop                    0x0050
  110. #define kDILeft                    0x0070
  111.  
  112. /*    kMinHeap - This is the minimum result from the following equation:
  113.         
  114.         ORD(GetApplLimit) - ORD(ApplicZone)
  115.         
  116.     for the application to run. It will insure that enough memory will
  117.     be around for reasonable-sized scraps, FKEYs, etc. to exist with the
  118.     application, and still give the application some 'breathing room'.
  119.     To derive this number, we ran under a MultiFinder partition that was
  120.     our requested minimum size, as given in the 'SIZE' resource. */
  121.      
  122. #define kMinHeap                66 * 1024
  123.     
  124. /*    kMinSpace - This is the minimum result from PurgeSpace, when called
  125.     at initialization time, for the application to run. This number acts
  126.     as a double-check to insure that there really is enough memory for the
  127.     application to run, including what has been taken up already by
  128.     pre-loaded resources, the scrap, code, and other sundry memory blocks. */
  129.      
  130. #define kMinSpace                49 * 1024
  131.  
  132. /* kExtremeNeg and kExtremePos are used to set up wide open rectangles and regions. */
  133.  
  134. #define kExtremeNeg                -32768
  135. #define kExtremePos                32767 - 1 /* required to address an old region bug */
  136.  
  137. /* these #defines are used to set enable/disable flags of a menu */
  138.  
  139. #define AllItems    0b1111111111111111111111111111111    /* 31 flags */
  140. #define NoItems        0b0000000000000000000000000000000
  141. #define MenuItem1    0b0000000000000000000000000000001
  142. #define MenuItem2    0b0000000000000000000000000000010
  143. #define MenuItem3    0b0000000000000000000000000000100
  144. #define MenuItem4    0b0000000000000000000000000001000
  145. #define MenuItem5    0b0000000000000000000000000010000
  146. #define MenuItem6    0b0000000000000000000000000100000
  147. #define MenuItem7    0b0000000000000000000000001000000
  148. #define MenuItem8    0b0000000000000000000000010000000
  149. #define MenuItem9    0b0000000000000000000000100000000
  150. #define MenuItem10    0b0000000000000000000001000000000
  151. #define MenuItem11    0b0000000000000000000010000000000
  152. #define MenuItem12    0b0000000000000000000100000000000
  153.